package com.huaju.enity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Ntype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ntype", catalog = "licai")
@JsonIgnoreProperties(value={"notices"})
public class Ntype implements java.io.Serializable {

	// Fields

	private Integer nid;
	private String nname;
	private String nimg;
	private Set<Notice> notices = new HashSet<Notice>(0);

	// Constructors

	/** default constructor */
	public Ntype() {
	}

	/** full constructor */
	public Ntype(String nname, String nimg, Set<Notice> notices) {
		this.nname = nname;
		this.nimg = nimg;
		this.notices = notices;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "nid", unique = true, nullable = false)
	public Integer getNid() {
		return this.nid;
	}

	public void setNid(Integer nid) {
		this.nid = nid;
	}

	@Column(name = "nname")
	public String getNname() {
		return this.nname;
	}

	public void setNname(String nname) {
		this.nname = nname;
	}

	@Column(name = "nimg")
	public String getNimg() {
		return this.nimg;
	}

	public void setNimg(String nimg) {
		this.nimg = nimg;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ntype")
	public Set<Notice> getNotices() {
		return this.notices;
	}

	public void setNotices(Set<Notice> notices) {
		this.notices = notices;
	}

}